# basic configuration...

from whiff import resolver

__wsgi_directory__ = True

resolver.publish_templates(__path__[0], globals(), mime_extensions=True)

# since we will be using the repoze middlewares a lot: import them
# so we can write
#    {{include "uid"...
# instead of
#    {{include "whiff_middleware/repoze/uid"...

from whiff.middleware.repoze import uid
from whiff.middleware.repoze import protect
from whiff.middleware.repoze import who
from whiff.middleware.repoze import allow
from whiff.middleware.repoze import onStatus
from whiff.middleware import absPath

# additional configuration for repoze/who based security
from whiff.middleware.repoze.protect import protectDirectory

import loggedInDir
loggedInDir = protectDirectory(loggedInDir, "loggedInDir", True, "failure")

import loggedOutDir
loggedOutDir = protectDirectory(loggedOutDir, "loggedOutDir", None, "failure")

import adminOnlyDir
adminOnlyDir = protectDirectory(adminOnlyDir, "adminOnlyDir", ["admin"], "failure")

import ChrissDir
ChrissDir = protectDirectory(ChrissDir, "ChrissDir", ["chris", "admin"], "failure")

